Optimal Query Time for Encoding Range Majority
نویسندگان
چکیده
We revisit the range τ -majority problem, which asks us to preprocess an array A[1..n] for a fixed value of τ ∈ (0, 1/2], such that for any query range [i, j] we can return a position in A of each distinct τ majority element. A τ -majority element is one that has relative frequency at least τ in the range [i, j]: i.e., frequency at least τ(j − i + 1). Belazzougui et al. [WADS 2013] presented a data structure that can answer such queries in O(1/τ) time, which is optimal, but the space can be as much as Θ(n lgn) bits. Recently, Navarro and Thankachan [Algorithmica 2016] showed that this problem could be solved using an O(n lg(1/τ)) bit encoding, which is optimal in terms of space, but has suboptimal query time. In this paper, we close this gap and present a data structure that occupies O(n lg(1/τ)) bits of space, and has O(1/τ) query time. We also show that this space bound is optimal, even for the much weaker query in which we must decide whether the query range contains at least one τ -majority element.
منابع مشابه
Better Space Bounds for Parameterized Range Majority and Minority
Karpinski and Nekrich (2008) introduced the problem of parameterized range majority, which asks to preprocess a string of length n such that, given the endpoints of a range, one can quickly find all the distinct elements whose relative frequencies in that range are more than a threshold τ . Subsequent authors have reduced their time and space bounds such that, when τ is given at preprocessing t...
متن کاملA Asymptotically Optimal Encodings of Range Data Structures for Selection and Top-k Queries
Given an array A[1, n] of elements with a total order, we consider the problem of building a data structure that solves two queries: (a) selection queries receive a range [i, j] and an integer k and return the position of the kth largest element in A[i, j]; (b) top-k queries receive [i, j] and k and return the positions of the k largest elements in A[i, j]. These problems can be solved in optim...
متن کاملThe Encoding Complexity of Two Dimensional Range Minimum Data Structures
In the two-dimensional range minimum query problem an input matrix A of dimension m× n, m ≤ n, has to be preprocessed into a data structure such that given a query rectangle within the matrix, the position of a minimum element within the query range can be reported. We consider the space complexity of the encoding variant of the problem where queries have access to the constructed data structur...
متن کاملAsymptotically Optimal Encodings for Range Selection
We consider the problem of preprocessing an array A[1..n] to answer range selection and range top-k queries. Given a query interval [i..j] and a value k, the former query asks for the position of the kth largest value in A[i..j], whereas the latter asks for the positions of all the k largest values in A[i..j]. We consider the encoding version of the problem, where A is not available at query ti...
متن کاملPrivate Key based query on encrypted data
Nowadays, users of information systems have inclination to use a central server to decrease data transferring and maintenance costs. Since such a system is not so trustworthy, users' data usually upkeeps encrypted. However, encryption is not a nostrum for security problems and cannot guarantee the data security. In other words, there are some techniques that can endanger security of encrypted d...
متن کامل